﻿@using PagedList.Mvc
@model PagedList.IPagedList<Model.LABELS>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<h2>Zawartość tabeli MBEW</h2>

<p>
<p>Załaduj dane.</p>
<div>
    @Html.ActionLink("Załaduj nowy plik", "Load", new { }, new { @class = "btn btn-primary" })
</div>
</p>

<div class="box-body">
    <table id="grid" class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>
                    LABELIDNUMBER:
                </th>
                <th>
                    LABELID:
                </th>
                <th>
                    PARTNUMBER:
                </th>
                <th>
                    QUANTITY:
                </th>
            </tr>
        </thead>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.LABELIDNUMBER)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.LABELID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PARTNUMBER)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.QUANTITY)
                </td>
                <td>
                    @Html.ActionLink("Edytuj", "Edit", new { id = @item.LABELIDNUMBER }, new { @class = "btn btn-primary" })
                </td>
            </tr>
        }

    </table>Strona @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) z @Model.PageCount

    @Html.PagedListPager(Model, page => Url.Action("Index",
    new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))

</div>
